home *** CD-ROM | disk | FTP | other *** search
/ VRML 2.0 Sourcebook (2nd Edition) / VRML 2.0 Sourcebook CD [md5 fed90f4f9c39d5a60d477058775c7e21].iso / book / mac / ch27 / 27fig01.wrl < prev    next >
Text File  |  1996-09-23  |  3KB  |  94 lines

  1. #VRML V2.0 utf8
  2. # The VRML 2.0 Sourcebook
  3. # Copyright [1997] By
  4. # Andrea L. Ames, David R. Nadeau, and John L. Moreland
  5. Group {
  6.     children [
  7.         NavigationInfo { headlight FALSE },
  8.     # Room
  9.         Inline { url "droom.wrl" },
  10.     # Wall
  11.         Transform {
  12.             translation 0.0 0.0 -5.0
  13.             children Inline { url "dwall2.wrl" }
  14.         },
  15.     # Left and right door panels
  16.         Transform {
  17.             translation 0.0 0.0 -4.95
  18.             children [
  19.                 DEF LeftDoor Transform {
  20.                     children Transform {
  21.                         translation -0.75 0.0 0.0
  22.                         children DEF Door Inline { url "ddoor.wrl" }
  23.                     }
  24.                 },
  25.                 DEF RightDoor Transform {
  26.                     children Transform {
  27.                         translation 0.75 0.0 0.0
  28.                         children USE Door
  29.                     }
  30.                 },
  31.             # Visibility Sensor
  32.                 DEF DoorSense VisibilitySensor {
  33.                     center 0.0 1.75 0.0
  34.                     size 3.0 2.5 1.0
  35.                 }
  36.             ]
  37.         },
  38.     # Sounds
  39.         Sound {
  40.             source DEF OpenSound AudioClip { url "clunk1.wav" }
  41.             minFront 20.0 minBack 20.0
  42.             maxFront 60.0 maxBack 60.0
  43.         },
  44.         Sound {
  45.             source DEF CloseSound AudioClip { url "clunk1.wav" }
  46.             minFront 20.0 minBack 20.0
  47.             maxFront 60.0 maxBack 60.0
  48.         },
  49.     # Animation clocks
  50.         DEF OpenClock TimeSensor {
  51.             cycleInterval 0.5
  52.         },
  53.         DEF CloseClock TimeSensor {
  54.             cycleInterval 0.5
  55.         },
  56.     # Animation paths for the left and right doors
  57.         DEF LeftOpen PositionInterpolator {
  58.             key [ 0.0, 1.0 ]
  59.             keyValue [ 0.0 0.0 0.0, -1.3 0.0 0.0 ]
  60.         },
  61.         DEF LeftClose PositionInterpolator {
  62.             key [ 0.0, 1.0 ]
  63.             keyValue [ -1.3 0.0 0.0, 0.0 0.0 0.0 ]
  64.         },
  65.         DEF RightOpen PositionInterpolator {
  66.             key [ 0.0, 1.0 ]
  67.             keyValue [ 0.0 0.0 0.0, 1.3 0.0 0.0 ]
  68.         },
  69.         DEF RightClose PositionInterpolator {
  70.             key [ 0.0, 1.0 ]
  71.             keyValue [ 1.3 0.0 0.0, 0.0 0.0 0.0 ]
  72.         }
  73.     ]
  74. }
  75. ROUTE DoorSense.enterTime         TO OpenSound.set_startTime
  76. ROUTE DoorSense.exitTime          TO OpenSound.set_stopTime
  77. ROUTE DoorSense.enterTime         TO OpenClock.set_startTime
  78. ROUTE DoorSense.exitTime          TO OpenClock.set_stopTime
  79.  
  80. ROUTE DoorSense.exitTime          TO CloseSound.set_startTime
  81. ROUTE DoorSense.enterTime         TO CloseSound.set_stopTime
  82. ROUTE DoorSense.exitTime          TO CloseClock.set_startTime
  83. ROUTE DoorSense.enterTime         TO CloseClock.set_stopTime
  84.  
  85. ROUTE OpenClock.fraction_changed  TO LeftOpen.set_fraction
  86. ROUTE OpenClock.fraction_changed  TO RightOpen.set_fraction
  87. ROUTE CloseClock.fraction_changed TO LeftClose.set_fraction
  88. ROUTE CloseClock.fraction_changed TO RightClose.set_fraction
  89.  
  90. ROUTE LeftOpen.value_changed      TO LeftDoor.set_translation
  91. ROUTE LeftClose.value_changed     TO LeftDoor.set_translation
  92. ROUTE RightOpen.value_changed     TO RightDoor.set_translation
  93. ROUTE RightClose.value_changed    TO RightDoor.set_translation
  94.